package cn.com.fattiger.framework;

public class VolatileDemo {
	public static volatile int i = 0;
	public static volatile int j = 0;
	public static void main(String[] args){
		new Thread(new Runnable(){
			public void run(){
//				i++;
				increment();
			}
		}).start();
		new Thread(new Runnable(){
			public void run(){
//				i++;
				increment();
			}
		}).start();
		System.out.println(i);
		System.out.println(j);
	}
	
	public static synchronized void increment(){
		j++;
	}
}
